<template>
  <section>
<!--    &lt;!&ndash;工具条&ndash;&gt;
    <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
      <el-form :inline="true" :model="filters">
        <el-form-item>
          <el-input v-model="filters.keyword" placeholder="品牌名称"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" v-on:click="queryBaran">查询</el-button>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="handleEdit()">新增</el-button>
        </el-form-item>
      </el-form>
    </el-col>-->

    <!--列表-->
    <el-table :data="audits" highlight-current-row  @selection-change="selsChange" style="width: 100%;">
      <el-table-column type="selection" width="55">
      </el-table-column>
      <el-table-column type="index" width="60">
      </el-table-column>

      <el-table-column prop="sellerId" label="商家ID" width="160" sortable>
      </el-table-column>

      <el-table-column prop="name" label="公司名称" width="160" sortable>
      </el-table-column>

      <el-table-column prop="nickName" label="店铺名称" width="160" sortable>
      </el-table-column>

      <el-table-column prop="linkmanName" label="联系人姓名" width="160" sortable>
      </el-table-column>

      <el-table-column prop="telephone" label="公司电话" width="160" sortable>
      </el-table-column>

      <el-table-column prop="status" label="公司状态" width="160" sortable>
        <template scope="scope">
          <span v-if="scope.row.status=='1'">
              审核通过
          </span>
          <span v-else-if="scope.row.status=='0'">
              待审核
          </span>
          <span v-else-if="scope.row.status=='2'">
              已驳回
          </span>
          <span v-else-if="scope.row.status=='3'">
              关闭账号
          </span>
        </template>
      </el-table-column>

      <el-table-column label="操作">
        <template scope="scope">
          <el-button size="small" :disabled="scope.row.status!='0'" @click="handleEdit(scope.$index, scope.row)">审核</el-button>
        </template>
      </el-table-column>
    </el-table>




    <el-dialog title="商家详情" :visible.sync="editBrandVisible" :close-on-click-modal="false">
      <el-form :model="audits" label-width="80px"  ref="editBrand">


        <el-tabs type="border-card">
          <el-tab-pane label="基本信息">
            <el-form-item label="公司名称：" prop="name">
              <el-input v-model="audits.name" auto-complete="off"></el-input>
            </el-form-item>

            <el-form-item label="公司手机：" prop="mobile">
              <el-input v-model="audits.mobile" auto-complete="off"></el-input>
            </el-form-item>

            <el-form-item label="公司电话：" prop="telephone">
              <el-input v-model="audits.telephone" auto-complete="off"></el-input>
            </el-form-item>

            <el-form-item label="公司详细地址：" prop="addressDetail">
              <el-input v-model="audits.addressDetail" auto-complete="off"></el-input>
            </el-form-item>
          </el-tab-pane>



          <el-tab-pane label="联系人">
            <el-form-item label="联系人姓名：" prop="linkmanName">
              <el-input v-model="audits.linkmanName" auto-complete="off"></el-input>
            </el-form-item>

            <el-form-item label="联系人QQ：" prop="linkmanQq">
              <el-input v-model="audits.linkmanQq" auto-complete="off"></el-input>
            </el-form-item>

            <el-form-item label="联系人手机：" prop="linkmanMobile">
              <el-input v-model="audits.linkmanMobile" auto-complete="off"></el-input>
            </el-form-item>

            <el-form-item label="联系人E—Mail：" prop="linkmanEmail">
              <el-input v-model="audits.linkmanEmail" auto-complete="off"></el-input>
            </el-form-item>
          </el-tab-pane>



          <el-tab-pane label="证件">
            <el-form-item label="营业执照号：" prop="licenseNumber">
              <el-input v-model="audits.licenseNumber" auto-complete="off"></el-input>
            </el-form-item>

            <el-form-item label="税务登记证号：" prop="taxNumber">
              <el-input v-model="audits.taxNumber" auto-complete="off"></el-input>
            </el-form-item>

            <el-form-item label="组织机构代码证号：" prop="orgNumber">
              <el-input v-model="audits.orgNumber" auto-complete="off"></el-input>
            </el-form-item>
          </el-tab-pane>



          <el-tab-pane label="法定代表人">
            <el-form-item label="法定代表人：" prop="legalPerson">
              <el-input v-model="audits.legalPerson" auto-complete="off"></el-input>
            </el-form-item>

            <el-form-item label="法定代表人身份证号：" prop="legalPersonCardId">
              <el-input v-model="audits.legalPersonCardId" auto-complete="off"></el-input>
            </el-form-item>
          </el-tab-pane>



          <el-tab-pane label="开户行">
            <el-form-item label="开户行名称：" prop="bankName">
              <el-input v-model="audits.v" auto-complete="off"></el-input>
            </el-form-item>
            <el-form-item label="银行账号：" prop="bankUser">
              <el-input v-model="audits.bankUser" auto-complete="off"></el-input>
            </el-form-item>
          </el-tab-pane>
        </el-tabs>


<!--        <el-form-item label="登陆密码：" prop="firstChar">
          <el-input v-model="createUser.firstChar" auto-complete="off"></el-input>
        </el-form-item>-->

      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click.native="editBrandVisible = false">取消</el-button>
        <el-button type="primary" @click="editSubmit('1')">通过</el-button>
        <el-button type="primary" @click="editSubmit('2')">驳回</el-button>
      </div>
    </el-dialog>



  </section>

</template>

<script>
export default {
  name: "GoodsIndexView",
  data(){
    return{
      audits:[],
      editBrandVisible:false,


    }
  },methods:{
    queryAudits(){
      this.$http.get("/seller/api/seller/queryAudits").then(
          resp=>{
            this.audits=resp.data.data
          }
      ).catch(resp=>{
        this.$message({
          message: "请登录",
          type: 'error'
        });
          }
      )
    },

    //编辑
    editSubmit: function (status) {
      this.$confirm('确认操作吗？', '提示', {}).then(() => {
        let parm ={
          status:status,
          sellerId:this.audits.sellerId
                  }
        this.$http.put("/seller/api/seller/updateStatus",parm).then(
            resp=>{
              this.audits=resp.data.data
              this.editBrandVisible=false
              this.queryAudits();
            }
        ).catch(resp=>{
              this.$message({
                message: "请登录",
                type: 'error'
              });
            }
        )
        });
    },


    handleEdit(index,row){
      this.audits=Object.assign({},row)
      this.editBrandVisible=true;
    },
  },
  mounted() {
    this.queryAudits();
  }
}
</script>

<style scoped>

</style>